/**@file
 * @brief scrRs.h实现
 * @author 朱项男<libxiangnan@gmail.com>
 * @date 2011/11/17
 * @version 0.0.1
 * @note
 * */

#include "result.h"

#include <string>
#include <ctime>
#include <assert.h>

using namespace std;

dat::Result::Result() :
		m_Log(""), m_StartTime(""), m_EndTime(""), m_Total(0), m_Success(0), m_Failure(
				0) {
	;
}

dat::Result::Result(const std::string & log, const std::string & startTime,
		const std::string & endTime, unsigned int total, unsigned int success,
		unsigned int failure) : m_Log(log), m_StartTime(startTime), m_EndTime(endTime), m_Total(total),
		m_Success(success), m_Failure(failure){
	;
}

dat::Result::~Result() {
	;
}

void dat::Result::Gets(std::string & log, std::string & startTime,
		std::string & endTime, unsigned int *total, unsigned int *success,
		unsigned int *failure) {
	assert(NULL != total);
	assert(NULL != success);
	assert(NULL != failure);

	log = m_Log;
	startTime = m_StartTime;
	endTime = m_EndTime;
	*total = m_Total;
	*success = m_Success;
	*failure = m_Failure;
}

void dat::Result::Sets(const std::string & log, const std::string & startTime,
		const std::string & endTime, unsigned int total, unsigned int success,
		unsigned int failure) {
	m_Log = log;
	m_StartTime = startTime;
	m_EndTime = endTime;
	m_Total = total;
	m_Success = success;
	m_Failure = failure;
}

void dat::Result::SetLog(const std::string & log) {
	m_Log = log;
}

std::string dat::Result::GetLog() {
	return m_Log;
}

void dat::Result::SetStartTime(const std::string & startTime) {
	m_StartTime = startTime;
}

std::string dat::Result::GetStartTime(void) {
	return m_StartTime;
}

void dat::Result::setEndTime(const std::string & endTime) {
	m_EndTime = endTime;
}

std::string dat::Result::GetEndTime(void) {
	return m_EndTime;
}

void dat::Result::SetTotal(unsigned int total) {
	m_Total = total;
}

unsigned int dat::Result::GetTotal(void) {
	return m_Total;
}

void dat::Result::SetSuccess(unsigned int success) {
	m_Success = success;
}

unsigned int dat::Result::GetSuccess(void) {
	return m_Success;
}

void dat::Result::SetFailure(unsigned int failure) {
	m_Failure = failure;
}

unsigned int dat::Result::GetFailure(void) {
	return m_Failure;
}
